package request1_p2p;

/**
 * @ClassName Rider
 * @Description 骑手类
 * @Author MaQingpin
 * @Date 2020/11/4 10:51
 * @Version 1.0
 */
public class Rider {
    private int id;
    private String name;
    private int[] location=new int[2];

    public Rider(int id, String name, int[] location) {
        this.id = id;
        this.name = name;
        this.location = location;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int[] getLocation() {
        return location;
    }

    public void setLocation(int[] location) {
        this.location = location;
    }

//    @Override
//    public void update(Observable o, Object arg) {
//        OrderDispatch dispatch=(OrderDispatch) o;
//        OrderEvent orderEvent=(OrderEvent)arg;
//        Merchant merchant=dispatch.getMerchant();
//        Double distance=Math.sqrt(Math.pow((location[0]-merchant.getLocation()[0]),2)+Math.pow((location[1]-merchant.getLocation()[1]),2));
//        System.out.println("骑手"+name+"您好！");
//        System.out.println("接收到订单配送任务："+orderEvent.getOrder_content());
//        System.out.println("商家距您："+distance+"公里");
//        System.out.println("-----------------------------");
//    }
}
